<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopSpaceDesignSoftOutfitMapping extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_space_design_soft_outfit_mapping', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo')->default('')->comment('订单编号');
            $table->string('preparationNo')->default('')->comment('筹备订单号');
            $table->unsignedInteger('fileId')->default(0)->comment('软装文件关联id');
            $table->integer('fee')->default(0)->comment('软装报价');
            $table->integer('payFee')->default(0)->comment('已支付金额');
            $table->integer('refundFee')->default(0)->comment('退款金额');
            $table->unsignedTinyInteger('orderStatus')->default(0)->comment('0 已生成 1进行中  2 已完成 3 已关闭');
            $table->unsignedTinyInteger('payStatus')->default(0)->comment('0 未付款 1 部分支付 2 已支付 3 部分退款 4 全额退款');
            $table->unsignedInteger('payTime')->default(0)->comment('支付时间');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除0否 1是');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->index('orderNo', 'idx_orderNo');
            $table->index('preparationNo', 'idx_preparationNo');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '空间设计软装关联表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_space_design_soft_outfit_mapping');
    }
}
